<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="language" content="en" />
        <link href="./assets/ffd55088/css/bootstrap.css" rel="stylesheet">
<link href="./assets/5cf9384a/solarized_light.css" rel="stylesheet">
<link href="./assets/6c54116e/style.css" rel="stylesheet">
<script src="./assets/a44cef0f/jquery.js"></script>
<script src="./assets/ffd55088/js/bootstrap.js"></script>
<script src="./assets/8ac4e28a/jssearch.js"></script>    <title>Yii Framework 2.0 API Documentation</title>
</head>
<body>

<div class="wrap">
    <nav id="w13663" class="navbar-inverse navbar-fixed-top navbar" role="navigation"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w13663-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button><a class="navbar-brand" href="./index.html">Yii Framework 2.0 API Documentation</a></div><div id="w13663-collapse" class="collapse navbar-collapse"><ul id="w13664" class="navbar-nav nav"><li><a href="./index.html">Class reference</a></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Extensions <b class="caret"></b></a><ul id="w13665" class="dropdown-menu"><li><a href="./ext-apidoc-index.html" tabindex="-1">apidoc</a></li>
<li><a href="./ext-authclient-index.html" tabindex="-1">authclient</a></li>
<li><a href="./ext-bootstrap-index.html" tabindex="-1">bootstrap</a></li>
<li><a href="./ext-codeception-index.html" tabindex="-1">codeception</a></li>
<li><a href="./ext-debug-index.html" tabindex="-1">debug</a></li>
<li><a href="./ext-elasticsearch-index.html" tabindex="-1">elasticsearch</a></li>
<li><a href="./ext-faker-index.html" tabindex="-1">faker</a></li>
<li><a href="./ext-gii-index.html" tabindex="-1">gii</a></li>
<li><a href="./ext-imagine-index.html" tabindex="-1">imagine</a></li>
<li><a href="./ext-jui-index.html" tabindex="-1">jui</a></li>
<li><a href="./ext-mongodb-index.html" tabindex="-1">mongodb</a></li>
<li><a href="./ext-redis-index.html" tabindex="-1">redis</a></li>
<li><a href="./ext-smarty-index.html" tabindex="-1">smarty</a></li>
<li><a href="./ext-sphinx-index.html" tabindex="-1">sphinx</a></li>
<li><a href="./ext-swiftmailer-index.html" tabindex="-1">swiftmailer</a></li>
<li><a href="./ext-twig-index.html" tabindex="-1">twig</a></li></ul></li>
<li><a href="./guide-README.html">Guide</a></li></ul><div class="navbar-form navbar-left" role="search">
  <div class="form-group">
    <input id="searchbox" type="text" class="form-control" placeholder="Search">
  </div>
</div>
</div></nav>
    <div id="search-resultbox" style="display: none;" class="modal-content">
        <ul id="search-results">
        </ul>
    </div>

    
<div class="row">
    <div class="col-md-3">
                <div id="navigation" class="list-group"><a class="list-group-item" href="#navigation-13654" data-toggle="collapse" data-parent="#navigation">yii\mongodb <b class="caret"></b></a><div id="navigation-13654" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-activefixture.html">ActiveFixture</a>
<a class="list-group-item" href="./yii-mongodb-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-batchqueryresult.html">BatchQueryResult</a>
<a class="list-group-item" href="./yii-mongodb-cache.html">Cache</a>
<a class="list-group-item" href="./yii-mongodb-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-command.html">Command</a>
<a class="list-group-item" href="./yii-mongodb-connection.html">Connection</a>
<a class="list-group-item" href="./yii-mongodb-database.html">Database</a>
<a class="list-group-item" href="./yii-mongodb-exception.html">Exception</a>
<a class="list-group-item" href="./yii-mongodb-logbuilder.html">LogBuilder</a>
<a class="list-group-item" href="./yii-mongodb-migration.html">Migration</a>
<a class="list-group-item" href="./yii-mongodb-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-querybuilder.html">QueryBuilder</a>
<a class="list-group-item" href="./yii-mongodb-session.html">Session</a></div>
<a class="list-group-item" href="#navigation-13655" data-toggle="collapse" data-parent="#navigation">yii\mongodb\console\controllers <b class="caret"></b></a><div id="navigation-13655" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-console-controllers-migratecontroller.html">MigrateController</a></div>
<a class="list-group-item" href="#navigation-13656" data-toggle="collapse" data-parent="#navigation">yii\mongodb\debug <b class="caret"></b></a><div id="navigation-13656" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-debug-explainaction.html">ExplainAction</a>
<a class="list-group-item" href="./yii-mongodb-debug-mongodbpanel.html">MongoDbPanel</a></div>
<a class="list-group-item" href="#navigation-13657" data-toggle="collapse" data-parent="#navigation">yii\mongodb\file <b class="caret"></b></a><div id="navigation-13657" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-file-activequery.html">ActiveQuery</a>
<a class="list-group-item" href="./yii-mongodb-file-activerecord.html">ActiveRecord</a>
<a class="list-group-item" href="./yii-mongodb-file-collection.html">Collection</a>
<a class="list-group-item" href="./yii-mongodb-file-cursor.html">Cursor</a>
<a class="list-group-item" href="./yii-mongodb-file-download.html">Download</a>
<a class="list-group-item" href="./yii-mongodb-file-query.html">Query</a>
<a class="list-group-item" href="./yii-mongodb-file-streamwrapper.html">StreamWrapper</a>
<a class="list-group-item" href="./yii-mongodb-file-upload.html">Upload</a></div>
<a class="list-group-item" href="#navigation-13658" data-toggle="collapse" data-parent="#navigation">yii\mongodb\gii\model <b class="caret"></b></a><div id="navigation-13658" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-gii-model-generator.html">Generator</a></div>
<a class="list-group-item" href="#navigation-13659" data-toggle="collapse" data-parent="#navigation">yii\mongodb\i18n <b class="caret"></b></a><div id="navigation-13659" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-i18n-mongodbmessagesource.html">MongoDbMessageSource</a></div>
<a class="list-group-item" href="#navigation-13660" data-toggle="collapse" data-parent="#navigation">yii\mongodb\log <b class="caret"></b></a><div id="navigation-13660" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-log-mongodbtarget.html">MongoDbTarget</a></div>
<a class="list-group-item" href="#navigation-13661" data-toggle="collapse" data-parent="#navigation">yii\mongodb\rbac <b class="caret"></b></a><div id="navigation-13661" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-rbac-mongodbmanager.html">MongoDbManager</a>
<a class="list-group-item" href="./yii-mongodb-rbac-permission.html">Permission</a>
<a class="list-group-item" href="./yii-mongodb-rbac-role.html">Role</a></div>
<a class="list-group-item" href="#navigation-13662" data-toggle="collapse" data-parent="#navigation">yii\mongodb\validators <b class="caret"></b></a><div id="navigation-13662" class="submenu panel-collapse collapse"><a class="list-group-item" href="./yii-mongodb-validators-mongodatevalidator.html">MongoDateValidator</a>
<a class="list-group-item" href="./yii-mongodb-validators-mongoidvalidator.html">MongoIdValidator</a></div></div>    </div>
    <div class="col-md-9 api-content" role="main">
        <h1>MongoDb Extension for Yii 2 <span id="mongodb-extension-for-yii-2"></span><a href="#mongodb-extension-for-yii-2" class="hashlink">&para;</a></h1>
<div class="toc"><ol><li><a href="#installation">Installation</a></li>
<li><a href="#configuration">Configuration</a></li></ol></div>
<p>This extension provides the <a href="http://www.mongodb.org/">MongoDB</a> integration for the <a href="http://www.yiiframework.com">Yii framework 2.0</a>.</p>
<p>For license information check the <a href="LICENSE.md">LICENSE</a>-file.</p>
<p>Documentation is at <a href="docs/guide/README.md">docs/guide/README.md</a>.</p>
<p><a href="https://packagist.org/packages/yiisoft/yii2-mongodb"><img src="https://poser.pugx.org/yiisoft/yii2-mongodb/v/stable.png" alt="Latest Stable Version" /></a>
<a href="https://packagist.org/packages/yiisoft/yii2-mongodb"><img src="https://poser.pugx.org/yiisoft/yii2-mongodb/downloads.png" alt="Total Downloads" /></a>
<a href="https://travis-ci.org/yiisoft/yii2-mongodb"><img src="https://travis-ci.org/yiisoft/yii2-mongodb.svg?branch=master" alt="Build Status" /></a></p>
<h2>Installation <span id="installation"></span><a href="#installation" class="hashlink">&para;</a></h2><p>This extension requires <a href="http://us1.php.net/manual/en/set.mongodb.php">MongoDB PHP Extension</a> version 1.0.0 or higher.</p>
<p>This extension requires MongoDB server version 3.0 or higher.</p>
<p>The preferred way to install this extension is through <a href="http://getcomposer.org/download/">composer</a>.</p>
<p>Either run</p>
<pre><code class="hljs nginx"><span class="hljs-title">php</span> composer.phar require --prefer-dist yiisoft/yii2-mongodb
</code></pre>
<p>or add</p>
<pre><code class="hljs bash"><span class="hljs-string">"yiisoft/yii2-mongodb"</span>: <span class="hljs-string">"~2.1.0"</span>
</code></pre>
<p>to the require section of your composer.json.</p>
<h2>Configuration <span id="configuration"></span><a href="#configuration" class="hashlink">&para;</a></h2><p>To use this extension, simply add the following code in your application configuration:</p>
<pre><code class="hljs php language-php"><span class="hljs-keyword">return</span> [
    <span class="hljs-comment">//....</span>
    <span class="hljs-string">'components'</span> =&gt; [
        <span class="hljs-string">'mongodb'</span> =&gt; [
            <span class="hljs-string">'class'</span> =&gt; <span class="hljs-string">'\yii\mongodb\Connection'</span>,
            <span class="hljs-string">'dsn'</span> =&gt; <span class="hljs-string">'mongodb://developer:password@localhost:27017/mydatabase'</span>,
        ],
    ],
];
</code></pre>
<h1>Class Reference</h1>

<table class="summaryTable docIndex table table-bordered table-striped table-hover">
    <colgroup>
        <col class="col-package" />
        <col class="col-class" />
        <col class="col-description" />
    </colgroup>
    <tr>
        <th>Class</th>
        <th>Description</th>
    </tr>
    <tr>
        <td><a href="yii-mongodb-activefixture.html">yii\mongodb\ActiveFixture</a></td>
        <td>ActiveFixture represents a fixture backed up by a <a href="yii-test-baseactivefixture.html#$modelClass-detail">MongoDB ActiveRecord class</a> or a <a href="yii-mongodb-activefixture.html#$collectionName-detail">MongoDB collection</a>.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-activequery.html">yii\mongodb\ActiveQuery</a></td>
        <td>ActiveQuery represents a Mongo query associated with an Active Record class.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-activerecord.html">yii\mongodb\ActiveRecord</a></td>
        <td>ActiveRecord is the base class for classes representing Mongo documents in terms of objects.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-batchqueryresult.html">yii\mongodb\BatchQueryResult</a></td>
        <td>BatchQueryResult represents a batch query from which you can retrieve data in batches.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-cache.html">yii\mongodb\Cache</a></td>
        <td>Cache implements a cache application component by storing cached data in a MongoDB.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-collection.html">yii\mongodb\Collection</a></td>
        <td>Collection represents the Mongo collection information.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-command.html">yii\mongodb\Command</a></td>
        <td>Command represents MongoDB statement such as command or query.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-connection.html">yii\mongodb\Connection</a></td>
        <td>Connection represents a connection to a MongoDb server.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-database.html">yii\mongodb\Database</a></td>
        <td>Database represents the Mongo database information.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-exception.html">yii\mongodb\Exception</a></td>
        <td>Exception represents an exception that is caused by some Mongo-related operations.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-logbuilder.html">yii\mongodb\LogBuilder</a></td>
        <td>LogBuilder allows composition and escaping of the log entries.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-migration.html">yii\mongodb\Migration</a></td>
        <td>Migration is the base class for representing a MongoDB migration.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-query.html">yii\mongodb\Query</a></td>
        <td>Query represents Mongo "find" operation.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-querybuilder.html">yii\mongodb\QueryBuilder</a></td>
        <td>QueryBuilder builds a MongoDB command statements.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-session.html">yii\mongodb\Session</a></td>
        <td>Session extends <a href="yii-web-session.html">yii\web\Session</a> by using MongoDB as session data storage.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-console-controllers-migratecontroller.html">yii\mongodb\console\controllers\MigrateController</a></td>
        <td>Manages application MongoDB migrations.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-debug-explainaction.html">yii\mongodb\debug\ExplainAction</a></td>
        <td>ExplainAction provides EXPLAIN information for MongoDB queries</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-debug-mongodbpanel.html">yii\mongodb\debug\MongoDbPanel</a></td>
        <td>MongoDbPanel panel that collects and displays MongoDB queries performed.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-activequery.html">yii\mongodb\file\ActiveQuery</a></td>
        <td>ActiveQuery represents a Mongo query associated with an file Active Record class.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-activerecord.html">yii\mongodb\file\ActiveRecord</a></td>
        <td>ActiveRecord is the base class for classes representing Mongo GridFS files in terms of objects.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-collection.html">yii\mongodb\file\Collection</a></td>
        <td>Collection represents the Mongo GridFS collection information.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-cursor.html">yii\mongodb\file\Cursor</a></td>
        <td>Cursor is a wrapper around <span class="broken-link">\MongoDB\Driver\Cursor</span>, which allows returning of the
record with <a href="yii-mongodb-file-download.html">yii\mongodb\file\Download</a> instance attached.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-download.html">yii\mongodb\file\Download</a></td>
        <td>Download represents the GridFS download operation.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-query.html">yii\mongodb\file\Query</a></td>
        <td>Query represents Mongo "find" operation for GridFS collection.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-streamwrapper.html">yii\mongodb\file\StreamWrapper</a></td>
        <td>StreamWrapper provides stream wrapper for MongoDB GridFS, allowing file operations via
regular PHP stream resources.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-file-upload.html">yii\mongodb\file\Upload</a></td>
        <td>Upload represents the GridFS upload operation.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-gii-model-generator.html">yii\mongodb\gii\model\Generator</a></td>
        <td>This generator will generate ActiveRecord class for the specified MongoDB collection.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-i18n-mongodbmessagesource.html">yii\mongodb\i18n\MongoDbMessageSource</a></td>
        <td>MongoDbMessageSource extends <a href="yii-i18n-messagesource.html">yii\i18n\MessageSource</a> and represents a message source that stores translated
messages in MongoDB collection.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-log-mongodbtarget.html">yii\mongodb\log\MongoDbTarget</a></td>
        <td>MongoDbTarget stores log messages in a MongoDB collection.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-rbac-mongodbmanager.html">yii\mongodb\rbac\MongoDbManager</a></td>
        <td>MongoDbManager represents an authorization manager that stores authorization information in MongoDB.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-rbac-permission.html">yii\mongodb\rbac\Permission</a></td>
        <td>Permission is a special version of <a href="yii-rbac-permission.html">yii\rbac\Permission</a> dedicated to MongoDB RBAC implementation.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-rbac-role.html">yii\mongodb\rbac\Role</a></td>
        <td>Role is a special version of <a href="yii-rbac-role.html">yii\rbac\Role</a> dedicated to MongoDB RBAC implementation.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-validators-mongodatevalidator.html">yii\mongodb\validators\MongoDateValidator</a></td>
        <td>MongoDateValidator is an enhanced version of <a href="yii-validators-datevalidator.html">yii\validators\DateValidator</a>, which supports <span class="broken-link">\MongoDate</span> values.</td>
    </tr>
    <tr>
        <td><a href="yii-mongodb-validators-mongoidvalidator.html">yii\mongodb\validators\MongoIdValidator</a></td>
        <td>MongoIdValidator verifies if the attribute is a valid Mongo ID.</td>
    </tr>
</table>
    </div>
</div>

<script type="text/javascript">
    /*<![CDATA[*/
    $("a.toggle").on('click', function () {
        var $this = $(this);
        if ($this.hasClass('properties-hidden')) {
            $this.text($this.text().replace(/Show/,'Hide'));
            $this.parents(".summary").find(".inherited").show();
            $this.removeClass('properties-hidden');
        } else {
            $this.text($this.text().replace(/Hide/,'Show'));
            $this.parents(".summary").find(".inherited").hide();
            $this.addClass('properties-hidden');
        }

        return false;
    });
    /*
     $(".sourceCode a.show").toggle(function () {
     $(this).text($(this).text().replace(/show/,'hide'));
     $(this).parents(".sourceCode").find("div.code").show();
     },function () {
     $(this).text($(this).text().replace(/hide/,'show'));
     $(this).parents(".sourceCode").find("div.code").hide();
     });
     $("a.sourceLink").click(function () {
     $(this).attr('target','_blank');
     });
     */
    /*]]>*/
</script>


</div>

<footer class="footer">
        <p class="pull-right"><small>Page generated on Sat, 09 Jul 2016 12:16:09 +0000</small></p>
    Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a></footer>

<script type="text/javascript">jQuery(document).ready(function () {
    var shiftWindow = function () { scrollBy(0, -50) };
    if (location.hash) setTimeout(shiftWindow, 1);
    window.addEventListener("hashchange", shiftWindow);
var element = document.createElement("script");
element.src = "./jssearch.index.js";
document.body.appendChild(element);

var searchBox = $('#searchbox');

// search when typing in search field
searchBox.on("keyup", function(event) {
    var query = $(this).val();

    if (query == '' || event.which == 27) {
        $('#search-resultbox').hide();
        return;
    } else if (event.which == 13) {
        var selectedLink = $('#search-resultbox a.selected');
        if (selectedLink.length != 0) {
            document.location = selectedLink.attr('href');
            return;
        }
    } else if (event.which == 38 || event.which == 40) {
        $('#search-resultbox').show();

        var selected = $('#search-resultbox a.selected');
        if (selected.length == 0) {
            $('#search-results').find('a').first().addClass('selected');
        } else {
            var next;
            if (event.which == 40) {
                next = selected.parent().next().find('a').first();
            } else {
                next = selected.parent().prev().find('a').first();
            }
            if (next.length != 0) {
                var resultbox = $('#search-results');
                var position = next.position();

//              TODO scrolling is buggy and jumps around
//                resultbox.scrollTop(Math.floor(position.top));
//                console.log(position.top);

                selected.removeClass('selected');
                next.addClass('selected');
            }
        }

        return;
    }
    $('#search-resultbox').show();
    $('#search-results').html('<li><span class="no-results">No results</span></li>');

    var result = jssearch.search(query);

    if (result.length > 0) {
        var i = 0;
        var resHtml = '';

        for (var key in result) {
            if (i++ > 20) {
                break;
            }
            resHtml = resHtml +
            '<li><a href="' + result[key].file.u.substr(3) +'"><span class="title">' + result[key].file.t + '</span>' +
            '<span class="description">' + result[key].file.d + '</span></a></li>';
        }
        $('#search-results').html(resHtml);
    }
});

// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });

});</script></body>
</html>
